package gameModel;


public class StdPiece implements Piece {
	
	// ATTRIBUTS
	
	private final PieceTypes type;
	private Player player;
	
	// CONSTRUCTEUR
	
	public StdPiece(Player p, PieceTypes t) {
		if (t == null || p == null) {
			throw new IllegalArgumentException();
		}
		type = t;
		player = p;
	}
	
	// REQUETES
	
	@Override
	public PieceTypes getType() {
		return type;
	}

	@Override
	public Player getPlayer() {
		return player;
	}
	
	@Override
	public String toString() {
		return "" + player.getName().charAt(0);
	}
	
	// COMMANDES

	@Override
	public void setPlayer(Player p) {
		if (p == null) {
			throw new IllegalArgumentException();
		}
		player = p;
	}

}
